<template>
  <demoBlock title="限制上传大小" padding>
    <vcu-uploader
      v-model="fileList"
      :max-size="100 * 1024"
      @oversize="onOversize"
    />
  </demoBlock>
</template>

<script>
import { defineComponent, ref } from "vue";
import { Toast } from "../../../components";
export default defineComponent({
  setup() {
    const fileList = ref([]);
    const onOversize = (file, detail) => {
      console.log(file, detail);
      Toast("文件大小不能超过 100kb");
    };
    return {
      fileList,
      onOversize,
    };
  },
});
</script>
